package tw.org.iii.activitysample;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class Act4 extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.act4);
		InitialComponent();
			
		}
	OnClickListener btnYes_click=new OnClickListener(){
		public void onClick(View arg0) {
			
			onSelectItemClick("Yes");
	}};
	OnClickListener btnNo_click=new OnClickListener(){
		public void onClick(View arg0) {
			onSelectItemClick("No");			
	}};
	
	protected void onSelectItemClick(String pstrOption) {

		Bundle bund=new Bundle();
		bund.putString("KK", pstrOption);
		
		Intent intent=new Intent();
		intent.putExtras(bund);
		setResult(0,intent);
		finish();
		
	}
	private void InitialComponent() {
		
		btnYes=(Button)findViewById(R.id.btnYes);
		btnYes.setOnClickListener(btnYes_click);
		btnNo=(Button)findViewById(R.id.btnNo);
		btnNo.setOnClickListener(btnNo_click);
	}
   

	Button btnYes=null;
	Button btnNo=null;
}
